cmake_minimum_required(VERSION 3.19)
project(googletest)

set(GOOGLETEST_INCLUDE_DIR /usr/local/googletest/include)
set(GOOGLETEST_LINK_DIR /usr/local/googletest/lib)
if (EXISTS ${GOOGLETEST_INCLUDE_DIR})
    add_executable(googletest
            main.cpp
            smartpointer/unique_ptr.cpp
            template/template.cpp
            uniform_initialzation/init.cpp
            misc/misc.cpp
            )

    target_include_directories(googletest
            PRIVATE
            ${GOOGLETEST_INCLUDE_DIR}
            $<INSTALL_INTERFACE:include>
            $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
            )

    target_link_directories(googletest
            PRIVATE
            ${GOOGLETEST_LINK_DIR}
            )

    target_link_libraries(googletest
            gtest
            gtest_main
            )
    target_compile_features(googletest PRIVATE cxx_std_14)
endif ()
